<?
	include_once('global.php');
	include_once('cURL.php');
	
	$results = GetSubjects();
	
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
	body {
		background-image: url('http://www.newpaltz.edu/images/bg_1.gif');
		font-family: Verdana, Geneva, sans-serif;
	}
	#all {
		width: 770px;
		background-color: white;
		margin: auto;
		padding: 10px 10px 10px 10px;
	}
	h4 {
		margin-top: 0px;
		margin-bottom: 0px;
	}
	.item {
		padding: 10px 10px 10px 10px;
	}
	.odd {
		background-color:#DFF;
	}
	.even {
		background-color:#FDF;
	}
	.feedTitle {
		float: right;
	}
</style>
</head>

<body>
	<div id="all">
        <form >
            <div class="dates">
            	<label for="subject">Subject:</label>
                <select name="subject" id="subject">
                    <? while($subjects = $results->fetch_assoc()){ ?>
                        <option value="<?=$subjects['id']?>"><?=$subjects['Name']?></option>
          	    	<? } ?>
                </select>
				<input type="hidden" name="id" value="<?=$subjects['id']?>" />
                <br />
                <label for="from">From:</label>
                <input name="from" id="from" />
                <br />
                <label for="to">To:</label>
                <input name="to" id="to" />
                <br />
                <input type="submit" value="Show" />
            </div>
        </form>
        <?
			$result = GetURL($subject['id']);
			$rs = $results->fetch_assoc();
			//$curl->createCurl($rs['URL']);
			//echo print_r($curl);
			//$json = json_decode($curl);
			//print_r($json);
		?>
        <br /><br />
        <? if($subjects['id'] == 1){
			   $feedTitle = $subjects['Name'];
		    }else{ 
				$feedTitle = $subjects['Name'];
			}
		?>
        <div class="list">
            <div class="item odd">
            	<div class="feedTitle"><?=$feedTitle?></div>
                <h4><a href="#">Title</a></h4>
                Description
            </div>
            <div class="item even">
            	<div class="feedTitle"><?=$feedTitle?></div>
                <h4><a href="#">Title</a></h4>
                Description
            </div>
        </div>
    </div>
</body>
</html>
